<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp" %>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="shortcut icon" href="../img/favicon.ico" >
	<link rel="stylesheet" href="../css/bootstrap.min.css">
	<link rel="stylesheet" href="../css/bootstrap-responsive.css">
	<link rel="stylesheet" href="../css/docs.css">
	
	<script type="text/javascript" src="../js/bootstrap.min.js"></script>
	<style type="text/css">
		body{
			background:url(../img/b.png);
			
		}
		
	</style>
</head>
<body class="body">
	<% pageContext.setAttribute("left", "file"); %>
	<%@ include file="include/top.jsp" %>
	
	
	<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-header">
	    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	    <h3 id="myModalLabel">分享新文件</h3>
	  </div>
	  <div class="modal-body">
	  <form action="savenewfile.jspx" method="post" enctype="multipart/form-data">
	  
	  
	    <div class="control-group">
		            <label class="control-label" for="input01">文件名称</label>
		            <div class="controls">
		              <input name="viewname" type="text" class="span5" id="input01" x-webkit-speech="undefined">
		            </div>
		          </div>
		          <div class="control-group">
		            <label class="control-label" for="input01"></label>
		            <div class="controls">
		              <input name="filename" type="file" class="span5" id="input01" x-webkit-speech="undefined">
		            </div>
		          </div>
	  </div>
	  <div class="modal-footer">
	    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
	    <button type="submit" class="btn btn-primary">上传</button>
	    </form>
	  </div>
	</div>
	<!-- 创建文件夹 -->
	<div id="myModal2" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-header">
	    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	    <h3 id="myModalLabel">创建文件夹</h3>
	  </div>
	  <div class="modal-body">
	  
	  <form action="savedirfid.jspx" method="post">
	  	
	  
	    <div class="form-horizontal">
		  <div class="control-group">
		    <label class="control-label" for="inputEmail">文件夹名</label>
		    <div class="controls">
		      <input type="text" name="name"id="inputEmail" placeholder="文件夹名">
		    </div>
		  </div>
		</div>
		
		
	  </div>
	  <div class="modal-footer">
	    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
	    <button type="submit" class="btn btn-primary">确定</button>
	    </form>
	  </div>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="container">
	  <div class="row">
		<%@ include file="include/left.jsp" %>
		<div class="span9">
			
			
			 <div class="span9">
			<h1 style="font-size:25px;"><a href="file.jspx"><i class="icon icon-file"></i>文件夹</a>／<span style="color:#ff7400">${filetype.name }</span>
				
				<a href="#myModal" role="button" class="btn btn-large btn-primary" data-toggle="modal" style="margin-left:500px;"><i class="icon-white  icon-share"></i>上传资料</a>
			</h1>
          <hr/>
			 
			 
		 <c:if test="${not empty dirmes }">
		 		<div class="alert alert-success">
	              <button type="button" class="close" data-dismiss="alert">×</button>
	              <strong>${dirmes }</strong>
	            </div>
	            <%
	            	request.getSession().removeAttribute("dirmes");
	            %>
		 </c:if>
		 	
		 
		 
			<div class="wall">
				<table class="table table-hover">
					<thead>
						<tr>
							<th width="30px"></th>
							<th width="60%">名称</th>
							<th width="20%">大小</th>
							<th>创建人</th>
							<th>删除</th>
						</tr>
					</thead>
					<tbody>
					
						<c:if test="${empty filelist }">
							<tr>
								<td colspan="5">
									<h3 style="color:red">还没有任何的资料</h3>
								</td>
								
							</tr>
							
						</c:if>
					
					
					
						<c:forEach items="${filelist }" var="s">
							<tr>
								<td>
									<img src="img/file.png"/>
								</td>
								<td><a href="filedown.jspx?n=${s.path }&id=${s.id}">${s.filename }</a></td>
								<td>${s.viewsize }</td>
								<td>${s.user.username }</td>
								<td><a href="javascript:;" class="mya" value="${s.id }"><i class="icon-trash"></i></a></td>
							</tr>
						</c:forEach>
						
						
					</tbody>
				</table>
				
				<a href="file.jspx">←返回</a>
			</div>
			
			
		</div>
	  </div>
	</div>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".mya").click(function(){
				var filetypeid = $(this).attr("value");
				if(confirm("你真的确定要删除资料么？")){
					location.href="removefile.jspx?id="+filetypeid;
				}
			});

		});
		
	</script>
</body>
</html>